{block admin_content}
{widget editUserForm}
<script type="text/javascript">
$(function(){
	var skillsInDepartment = {$skillsInDepartment};
	$("select[name=department_id]").change(showSkills);
	showSkills();
	function showSkills(){
		var dep = $("select[name=department_id]").val();
		$('.cbli').each(function(){
			if(!skillsInDepartment.hasOwnProperty(dep) || skillsInDepartment[dep].indexOf($(this).val()) == -1){
				$(this).removeAttr('checked');
				$(this).hide();
				$(this).next('label').hide();
			}else{
				$(this).show();
				$(this).next('label').show();
			}
		});
	}
});
</script>
{/block}